home *** CD-ROM | disk | FTP | other *** search
/ Apple Developer Connection 1998 Fall: Game Toolkit / Disc.iso / Samples / Moofwars 1.02 / MoofWars Sprocket / •Headers / TSpriteCollection.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-11-05  |  1.6 KB  |  64 lines  |  [TEXT/CWIE]

  1. /*************************************************************************************
  2. #
  3. TSpriteCollection.h
  4.  
  5. This class represents a group of related Sprites.  For example, all of the shots
  6. fired by a sprite.  In general, the various things that happen to sprites (moving,
  7. drawing, hit testing) all happen to a whole group at a time.
  8. #
  9. #
  10. Author: Timothy Carroll
  11. Apple Developer Technical Support
  12. timc@apple.com
  13. #
  14. Modification History: 
  15. #
  16. 8/15/96        TMC     Initial Release
  17. #
  18. Copyright © 1996 Apple Computer, Inc., All Rights Reserved
  19. #
  20. #
  21. You may incorporate this sample code into your applications without
  22. restriction, though the sample code has been provided "AS IS" and the
  23. responsibility for its operation is 100% yours.  However, what you are
  24. not permitted to do is to redistribute the source as "DSC Sample Code"
  25. after having made changes. If you're going to re-distribute the source,
  26. we require that you make it clear in the source that the code was
  27. descended from Apple Sample Code, but that you've made changes.
  28. #
  29. *************************************************************************************/
  30.  
  31.  
  32. #ifndef _TSpriteCollection_
  33. #define _TSpriteCollection_
  34.  
  35. #pragma once
  36.  
  37. #include "TSprite.h"
  38.  
  39.  
  40. #if PRAGMA_STRUCT_ALIGN
  41. #pragma options align=power
  42. #endif
  43.  
  44. class TSpriteCollection
  45. {
  46.     public:
  47.         TSpriteCollection();
  48.         ~TSpriteCollection();
  49.         void AddSprite (TSprite *theSprite);
  50.         void RemoveSprite (TSprite *theSprite);
  51.         
  52.         void ProcessSpriteGroup (void);
  53.         void HitTest (TSpriteCollection *targetGroup);
  54.         void DrawSpriteGroup (void);
  55.         
  56.     protected:
  57.         TSprite *fSpriteListHead;
  58. };
  59.  
  60. #if PRAGMA_STRUCT_ALIGN
  61. #pragma options align=reset
  62. #endif
  63.  
  64. #endif /* _TSpriteCollection_ */